package Day1;

import Day1.che.Car;
import Day1.che.Truck;
import Day1.graph.Circle;
import Day1.graph.Rectangle;

public class Test {
    public static void main(String[] args) {
        System.out.println("第一题");
        System.out.println();
        Car smallCar = new Car("奔驰", 200);
        smallCar.drive();
        smallCar.honk();

        Truck truck = new Truck("大众", 100);
        truck.drive();
        truck.honk();

        smallCar.setBrand("小鹏");
        System.out.println("小汽车品牌：" + smallCar.getBrand());

        truck.setMaxSpeed(60);
        System.out.println("卡车最大速度：" + truck.getMaxSpeed());
        System.out.println();
        System.out.println();
        System.out.println("第二题");
        System.out.println();
        Circle circle = new Circle("红色", 5.0);
        circle.draw();
        System.out.printf("圆形面积:%.2f\n" , circle.getArea());
        Rectangle rectangle = new Rectangle("绿色", 4.0, 6.0);
        rectangle.draw();
        System.out.println("矩形面积:" + rectangle.getArea());
        circle.setColor("蓝色");
        System.out.println("圆形颜色:" + circle.getColor());
        rectangle.setWidth(8.0);
        rectangle.setHeight(10.0);
        System.out.println("矩形尺寸: 宽:" + rectangle.getWidth() + "高:" + rectangle.getHeight());
    }
}
